package com.zzy.demo.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class EncodeController {

	@RequestMapping("/urlcode")
	public String urlcode(Model model) {
		return "urlcode";
	}
	
	@RequestMapping("/urldecode")
	@ResponseBody
	public String urldecode(HttpServletRequest request, HttpServletResponse response, Model model) {
		String keyword = request.getParameter("keyword");
		return keyword;
	}
	
	
	@RequestMapping("/hex16")
	public String hex(HttpServletRequest request, HttpServletResponse response, Model model) {
		return "hex16";
	}
	
	
	@RequestMapping("/escape")
	public String escape(HttpServletRequest request, HttpServletResponse response, Model model) {
		return "escape";
	}


}
